<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <div id="box"></div>
    <script>
        var box=document.querySelector("#box")
        var xhr=new XMLHttpRequest()
        xhr.open("GET","./data.php")
        xhr.send();
        xhr.onreadystatechange=function(){
            if(xhr.readyState===4){
                var data=JSON.parse(xhr.responseText)
                var html=""
                for(var i=0;i<data.length;i++){
                    console.log(data[i]);
                    html+=`
                    <li>
                        <img src="${data[i].imgurl}">
                        <p>
                            ${data[i].h1s}
                        </p>
                    </li>
                    `
                }
                box.innerHTML=html
            }
        }
    </script>
</body>
</html>